package com.springboot5.demo.endpoint;

import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Endpoint(id = "myservice")
@Component
public class MyServiceEndpoint {

    @ReadOperation
    public Map read(){
        Map<String,String> map=new HashMap<>();
        map.put("dock","xxxxxxxxxxxxxxx");
        return map;
    }

    @WriteOperation
    public void write(){
        System.out.println("docke qdaw a dwd q");
    }

}
